package isssr.boundary.src;

import isssr.control.src.UserAuthenticationControl;
import java.io.Serializable;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.RequestScoped;


/**
 * @author Ludovico 
 *
 */
@ManagedBean(name="loginFormBoundary")
@RequestScoped
public class LoginFormBoundary implements Serializable {

	
	private static final long serialVersionUID = 5370949219818185926L;
	private String username;
	private String password;
	
	@ManagedProperty(value="#{userAuthenticationControl}")
	private UserAuthenticationControl control;
	
	
	public LoginFormBoundary(){}


	public String getUsername() {
		return username;
	}


	public void setUsername(String username) {
		this.username = username;
	}


	public String getPassword() {
		return password;
	}


	public void setPassword(String password) {
		this.password = password;
	}
	
	
	public void setControl(UserAuthenticationControl control) {
		this.control = control;
	}


	public String login()
	{
		return this.control.login(this.getUsername(), this.getPassword());
	}
	
	
}
